#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int t;
vector<int> mul(vector<int>& x, vector<int>& y) {
    int n = x.size(), m = y.size();
    vector<int> ans(min(520, n + m + 5), 0); // 限制长度最多 520 位
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < m && i + j < 520; j++) {
            ans[i + j] += x[i] * y[j]; 
            if (i + j + 1 < 520)
                ans[i + j + 1] += ans[i + j] / 10;
            ans[i + j] %= 10;
        }
    }
    while (ans.size() > 1 && ans.back() == 0) ans.pop_back();
    return ans;
}
vector<int> sub(vector<int> a, int b) {
    int i = 0;
    while (b > 0) {
        if (i < a.size()) {
            a[i] -= b % 10;
            if (a[i] < 0) {
                a[i] += 10;
                b = b / 10 + 1; // 借位
            } else {
                b /= 10;
            }
        } else {
            // b 比 a 大，不支持负数结果
            throw runtime_error("Result would be negative!");
        }
        i++;
    }

    // 去掉前导 0
    while (a.size() > 1 && a.back() == 0)
        a.pop_back();
    while (a.size() > 510) a.pop_back(); // 限制长度
    return a;
}
// 这里是高精度算法加快速幂的结合，这里比较关键，画重点了
vector<int> power(int base, int exp) {
    vector<int> res = {1};
    vector<int> b = {base};
    while(exp > 0) {
        if(exp % 2 == 1) {
            res = mul(res, b);
        }
        b = mul(b, b);
        exp /= 2;
    }
    return res;
}
void slove(int n) {
    vector<int> temp = power(2, n);
    temp = sub(temp, 1);
    int k = 500;
    int f = 0;
    if(t < 500) {
        k = t;
        for(int i = 0; i < 500 - t; i++) {
            cout << "0";
            f++;
            if(f % 50 == 0) {
                cout << endl;
            }
        }
    }
    for(int i = k - 1; i >= 0; i--) {
        cout << temp[i];
        f++;
        if(f % 50 == 0) {
            cout << endl;
        }
    }
}
int main() {
    int n;
    cin >> n;
    t = int(log10(2) * n) + 1;
    cout << t << endl;
    slove(n);
    return 0;
}